<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit"/><!-- 让360浏览器默认选择webkit内核 -->

    <!-- 全局css  -->
    <link rel="shortcut icon" href="${ctxPath}/static/favicon.ico">
    <link href="${ctxPath}/static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${ctxPath}/static/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="${ctxPath}/static/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="${ctxPath}/static/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="${ctxPath}/static/css/plugins/validate/bootstrapValidator.min.css" rel="stylesheet">
    <link href="${ctxPath}/static/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="${ctxPath}/static/css/_fstyle.css" rel="stylesheet">
    <link href="${ctxPath}/static/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="${ctxPath}/static/css/plugins/webuploader/webuploader.css" rel="stylesheet">
    <link href="${ctxPath}/static/css/plugins/ztree/zTreeStyle.css" rel="stylesheet">
    <link href="${ctxPath}/static/css/plugins/bootstrap-treetable/bootstrap-treetable.css" rel="stylesheet"/>
    <!-- <link href="${ctxPath}/static/css/plugins/ztree/demo.css" rel="stylesheet"> -->

    <!-- 全局js  -->
    <script src="${ctxPath}/static/js/jquery.min.js?v=2.1.4"></script>
    <script src="${ctxPath}/static/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="${ctxPath}/static/js/plugins/ztree/jquery.ztree.all.min.js"></script>
    <script src="${ctxPath}/static/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="${ctxPath}/static/js/plugins/validate/bootstrapValidator.min.js"></script>
    <script src="${ctxPath}/static/js/plugins/validate/zh_CN.js"></script>
    <script src="${ctxPath}/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="${ctxPath}/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="${ctxPath}/static/js/plugins/bootstrap-treetable/bootstrap-treetable.js"></script>
    <script src="${ctxPath}/static/js/plugins/layer/layer.js"></script>
    <script src="${ctxPath}/static/js/plugins/chosen/chosen.jquery.js"></script>
    <script src="${ctxPath}/static/js/plugins/iCheck/icheck.min.js"></script>
    <script src="${ctxPath}/static/js/plugins/laydate/laydate.js"></script>
    <script src="${ctxPath}/static/js/plugins/webuploader/webuploader.min.js"></script>
    <script src="${ctxPath}/static/js/common/ajax-object.js"></script>
    <script src="${ctxPath}/static/js/common/bootstrap-table-object.js"></script>
    <script src="${ctxPath}/static/js/common/tree-table-object.js"></script>
    <script src="${ctxPath}/static/js/common/web-upload-object.js"></script>
    <script src="${ctxPath}/static/js/common/ztree-object.js"></script>
    <script src="${ctxPath}/static/js/common/Feng.js"></script>
    

    
    <!-- <link href="${ctxPath}/static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <script src="${ctxPath}/static/js/jquery.min.js?v=2.1.4"></script>
    <script src="${ctxPath}/static/js/bootstrap.min.js?v=3.3.6"></script>
     -->
    
    <!-- jqgrid 5.3 -->
    <!-- 
    <link href="${ctxPath}/static/css/plugins/jqGrid/trirand/ui.jqgrid.css" rel="stylesheet">
     -->
	<link rel="stylesheet" type="text/css" media="screen" href="${ctxPath}/static/css/plugins/jqGrid/trirand/ui.jqgrid-bootstrap.css" />
	    
    <script type="text/ecmascript" src="${ctxPath}/static/js/plugins/jqGrid/bootstrap-datepicker.js"></script> 
    <script type="text/ecmascript" src="${ctxPath}/static/js/plugins/jqGrid/bootstrap3-typeahead.js"></script> 
    <link rel="stylesheet" type="text/css" media="screen" href="${ctxPath}/static/css/plugins/jqGrid/bootstrap-datepicker.css" />
    
    <script src="${ctxPath}/static/js/plugins/jqGrid/trirand/jquery.jqGrid.min.js"></script>
    <script src="${ctxPath}/static/js/plugins/jqGrid/trirand/i18n/grid.locale-cn.js"></script>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>品牌管理</h5>
            </div>
            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="col-sm-12">
                        <div class="row">
                            <div class="col-sm-3">
                                <#NameCon id="condition" name="名称" />
                            </div>
                            <div class="col-sm-3">
                                <#button name="搜索" icon="fa-search" clickFun="ItemBrand.search()"/>
                            </div>
                        </div>
                        <div class="hidden-xs" id="ItemBrandTableToolbar" role="group">
                            @if(shiro.hasPermission("/itemBrand/add")){
                                <#button name="添加" icon="fa-plus" clickFun="ItemBrand.openAddItemBrand()"/>
                            @}
                            @if(shiro.hasPermission("/itemBrand/update")){
                                <#button name="修改" icon="fa-edit" clickFun="ItemBrand.openItemBrandDetail()" space="true"/>
                            @}
                            @if(shiro.hasPermission("/itemBrand/delete")){
                                <#button name="删除" icon="fa-remove" clickFun="ItemBrand.delete()" space="true"/>
                            @}
                        </div>
                       	<div>
	                        <table id="ItemBrandGrid"/>
	                        <div id="ItemBrandPager"></div>
	                   	</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
$.jgrid.defaults.width = 780;

$(document).ready(function () {
	$("#ItemBrandGrid").jqGrid({
		url: '/itemBrand/jqGridData',
		mtype: "GET",
		styleUI : 'Bootstrap',
		datatype: "json",
		colModel: [
            @if(shiro.hasPermission("/itemBrand/update")||shiro.hasPermission("/itemBrand/delete")){
			{ label: '操作', name:'act', index:'', width:80, fixed:true, sortable:false, resize:false,
				formatter:'actions',
				formatoptions: {
                    keys: true,
					mtype: 'POST',
                    @if(shiro.hasPermission("/itemBrand/update")){
					editbutton:true,
					editformbutton: true,
					onEdit : null,
					onSuccess : false,
					url : "",
					extraparam : {},
					afterSave : null,
					onError : null,
					afterRestore : null,
					restoreAfterError: null,
					@}
		            @if(shiro.hasPermission("/itemBrand/delete")){
					delbutton:true,
					@}
					editOptions: {},
					addOptions: {},
					delOptions: {}
                }    
			},
			@}
			{ label: 'ID', name: 'brandId', index: 'brandId', hidden: true},			
			{ label: '品牌名称', name: 'brandName', index: 'brandName',width: 100}, //, align: 'left', sorttype: 'text', formatter: 'text',
			{ label: '描述', name: 'brandShortDesc', index: 'brandShortDesc',width: 100 },
			{ label: '商品分类', name: 'categoryIds', index: 'categoryIds', width: 100 },
			{ label: '创建日期', name: 'created', index: 'created', width: 100 },
		],
		loadonce: false,
		footerrow: true,
		//userDataOnFooter: true, // use the userData parameter of the JSON response to display data on footer
		viewrecords: true,
		width: 780,
		height: 200,
		autowidth : true,
		pager: "#ItemBrandPager",
		rowList: [10, 20, 50],
		rowNum: 10,
		editurl : "dummy.html",
		deleteurl: '/itemBrand/delete',
    });
	
	/*
	jQuery("#ItemBrandGrid").jqGrid({
		
		//url: "member/getdata.do",
		//datatype: "json",
		datatype: "json",
		data: mydata,		
		height: 450,
		colNames:[' ', 'ID','姓名','性别', '电话', '地址','#'],
		colModel:[
			{name:'act',index:'', width:80, fixed:true, sortable:false, resize:false,
				formatter:'actions', 
			},
			{name:'id',index:'id', width:60, sorttype:"int", editable: false},
			{name:'fname',index:'fname',width:90, editable:true},
			{name:'gender',index:'gender', width:150,editable: true},
			{name:'tel',index:'tel', width:70, editable: true},
			{name:'regAddress',index:'regAddress', width:90, editable: true},
			{name:'course',index:'course', width:150, sortable:true,editable: true} 
		], 

		viewrecords : true,
		rowNum:10,
		rowList:[10,20,30],
		pager : '#ItemBrandPager',
		sortname : 'id',
		toolbarfilter : true,
		viewrecords : true,
		sortorder : "asc",
		gridComplete : function() {
			var ids = jQuery("#jqgrid").jqGrid('getDataIDs');
			for (var i = 0; i < ids.length; i++) {
				var cl = ids[i];
				be = "<button class='btn btn-xs btn-default' data-original-title='Edit Row' onclick=\"jQuery('#jqgrid').editRow('" + cl + "');\"><i class='fa fa-pencil'></i></button>";
				se = "<button class='btn btn-xs btn-default' data-original-title='Save Row' onclick=\"jQuery('#jqgrid').saveRow('" + cl + "');\"><i class='fa fa-save'></i></button>";
				ca = "<button class='btn btn-xs btn-default' data-original-title='Cancel' onclick=\"jQuery('#jqgrid').restoreRow('" + cl + "');\"><i class='fa fa-times'></i></button>";
				//ce = "<button class='btn btn-xs btn-default' onclick=\"jQuery('#jqgrid').restoreRow('"+cl+"');\"><i class='fa fa-times'></i></button>";
				//jQuery("#jqgrid").jqGrid('setRowData',ids[i],{act:be+se+ce});
				jQuery("#jqgrid").jqGrid('setRowData', ids[i], {
					act : be + se + ca
				});
			}
		},
		editurl : "dummy.html",
		caption : "客户列表",
		multiselect : true,
		autowidth : true,

	});	
	*/
	
});	
	/*
	$("#ItemBrandGridExport").on("click", function(){
		$("#ItemBrandGrid").jqGrid("exportToPdf",{
			title: 'PDF导出',
			orientation: 'portrait',
			pageSize: 'A4',
			description: '品牌管理列表',
			customSettings: null,
			download: 'download',
			includeLabels : true,
			includeGroupHeader : true,
			includeFooter: true,
			fileName : "ItemBrand.pdf"
		})
	});
	*/
</script>
<script src="/static/modular/biz/itemBrand/itemBrand.js"></script>
</div>
<script src="/static/js/content.js?v=1.0.0"></script>
</body>
</html>
